home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11000 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: uni-erlangen.de!winx03!sunshine!schoof
  2. From: schoof@informatik.uni-wuerzburg.de (Jochen Schoof)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Beginer C please help me
  5. Date: 21 Mar 1996 12:58:50 GMT
  6. Organization: University of Wuerzburg, Germany
  7. Message-ID: <4irjqa$jtn@winx03.informatik.uni-wuerzburg.de>
  8. References: <DoLCFx.B7x.0.bloor@torfree.net> <4iq6uc$evq@daryl.scsn.net>
  9. NNTP-Posting-Host: wi2x01.informatik.uni-wuerzburg.de
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Scott Shrader (shrader@scsn.net) wrote:
  13. : In article <DoLCFx.B7x.0.bloor@torfree.net>, bz786@torfree.net says...
  14. : >
  15. : >This may be a stupid mistake but "please help" me.
  16. : >Thank you very much.
  17. : >
  18. : >#include <stdio.h>
  19. : >#include <math.h>
  20. : >main ()
  21. : >{
  22. : >float n;
  23. : >n=(9/5);
  24. : >printf ("n=   %1.3f\n", n);
  25. : >}
  26. : >I have complied and run the programme & I got the answer n=1.000
  27. : >but Iam supposed to get answer 1.8.
  28. : >Why I got this answer?
  29. : >-- 
  30. : you can write this by skipping  printf("n=   %1.3f\n", n); and put in 
  31. : printf("%f",n);
  32. :
  33. : Try this to see how this works. 
  34.  
  35. What you wrote is complete nonsense. How about testing the programs
  36. before posting them..? Even learning C might be of help.
  37.  
  38. : I'm a bit new at this too, but I think this will work.
  39.  
  40. If you have to use phrases like "I think it will work" or "I'm not sure"
  41. in your posting, please don't post it. There are enough folks around 
  42. here who know for sure - especially in elementary cases like this one.
  43.  
  44. - Jochen
  45.  
  46. --
  47. --------------------------------------------------------------------------
  48.  Jochen Schoof                  mailto:schoof@informatik.uni-wuerzburg.de
  49.  Lehrstuhl fuer Informatik II +-------------------------------------------
  50.  Universitaet Wuerzburg       | You are just reading a .sig-light:
  51.  D-97074 Wuerzburg (Germany)  | It is free of fat, sugar and cholesterol!
  52. ------------------------------+-------------------------------------------
  53.  WWW-Homepage:        http://www.informatik.uni-wuerzburg.de/staff/joscho
  54. --------------------------------------------------------------------------
  55.